package com.jc.demo.hadoop.jdata;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.orc.mapred.OrcStruct;

import java.io.IOException;

public class BlankPhoneMapper extends Mapper<NullWritable, OrcStruct, Text, Text> {
    public void map(NullWritable key, OrcStruct value, Context output)
            throws IOException, InterruptedException {

        Text phone = (Text) value.getFieldValue(3);
        Text report = (Text) value.getFieldValue(23);
        Text date_t = (Text) value.getFieldValue(18);
        if(report.toString().contains("空号")) {
            output.write(phone, date_t);
        }
    }

}